<admintpl file="header" />

<link href="__TMPL__Public/assets/css/infomation.css" rel="stylesheet" />
</head>
<body>
    <div class="wrap">
        <ul class="nav nav-tabs">
            <li><a href="{:U('PaymentReview/index')}">工程款支付报审表管理</a></li>
            <if condition="($Role eq 2) AND ($userrole['role'] eq 5)">
            	<li><a href="{:U('PaymentReview/add')}">新增工程款支付报审</a></li>
            </if>
            <li class="active"><a href="{:U('PaymentReview/view', array('id'=>I('request.id/s','')))}">查看工程款支付报审</a></li>
        </ul>
        <section class="tab-pane active fade in" id="access">
            <div class="row">
                <div class="col-xs-12 col-md-12 col-lg-12">
                    <div class="panel panel-info">
                        <div class="panel-body">
                            <form method="post" class="form-horizontal " action="{:U('PaymentReview/audit_post')}">
                                <input type="hidden" name="table_id" value="{$result.id}" />
                                <input type="hidden" name="audit_level" value="{$result.audit_level}" />
                                <div class="row tg-header">
                                    <div class="col-md-12 text-center">
                                        <h3>工程款支付报审表</h3>
                                        <hr />
                                    </div>
                                    <div class="col-md-12">
                                        <p class="tg-to"><label>工程名称:</label><input type="text" class="input-xt input-deptname" value="{$job_name}" readonly/></p>
                                        <p class="pull-right tg-serialnum"><label>编号:</label><input class="input-xt" name="code" required value="{$result.code}" readonly /></p>
                                    </div>
                                </div>

                                <table class="table table-bordered">
                                    <tr>
                                        <td style="border-right:none !important;">
                                            <p>
                                                <label>致：<input type="text" class="input-xt input-deptname"  name="supervisory_department" value="{$result.supervisory_department}" readonly />（项目监理机构）:</label>
                                            </p>
                                            <p class="indent20">
                                                我方已完成<input type="text" class="input-xt input-longname" name="job_content" required value="{$result.job_content}" readonly />工作，该本月工程量清单计价为：<input type="text" class="input-xt input-name" readonly
                                                	 name="list_pricing" required value="{$result.list_pricing}" />元。建设单位应支付该工程款的75%即<input type="text" class="input-xt input-xt input-name" name="payables" required readonly
                                                     value="{$result.payables}" />元（大写）<input type="text" class="input-xt input-deptname" readonly name="amount_in_words" required value="{$result.amount_in_words}" />，现将有关资料报上，请予以审核。
                                            </p>
                                            <p></p>
                                            <p class="indent20">
                                                附件：
                                                <div class="controls" style="margin-left: 12px">
                                                    <ol>
                                                        <li><a href="{:U('PaymentReview/projectview', array('id'=>I('request.id/s',''), 'isAudit' => $isAudit, 'level' => $result['audit_level'], 'deptId' => $result['add_department']))}">工程量清单报审表</a></li>
                                                        <if condition="$result['audit_level'] gt 3">
                                                        	<li><a href="{:U('PaymentReview/payment', array('id'=>I('request.id/s','')))}">工程款支付证书</a></li>
                                                        	<li><a href="{:U('PaymentReview/stepview', array('id'=>I('request.id/s','')))}">施工进度表</a></li>
                                                        </if>
                                                        <if condition="$result['audit_level'] gt 4">
                                                        	<li><a href="{:U('PaymentReview/assetview', array('id'=>I('request.id/s','')))}">固定资产统计表</a></li>
                                                        </if>
                                                        <li><a href="{:U('PaymentReview/siteview', array('id'=>I('request.id/s',''), 'isAudit' => $isAudit, 'level' => $result['audit_level']))}">现场工程量计量表</a></li>
                                                    </ol>
                                                </div>
                                            </p>
                                            <div class="signature">
                                                <p>
                                                    承包单位（盖章）
                                                </p>
                                                <p>
                                                    项目经理（签字)
                                                </p>
                                            </div>
                                            <p class="signature-date">
                                                <span>{$result.publish_time|substr=0,4}年</span>
                                                <span>{$result.publish_time|substr=5,2}月</span>
                                                <span>{$result.publish_time|substr=8,2}日</span>
                                            </p>         
                                        </td>
                                    </tr>
                                    <if condition="($audit[3] OR $isAudit eq '2') AND $result['audit_level'] egt 3">
                                    <tr class="level3">
                                        <td colspan="4">
                                            监理单位审核意见:
                                            <p class="indent20"> 
                                                本期同意支付工程款为：（小写）<input type="text" class="input-xt input-name"  name="supervision_amount" value="{$result.supervision_amount}" required readonly>，（大写）
                                                <input type="text" class="input-xt input-deptname"  name="supervision_amount_words" required value="{$result.supervision_amount_words}" readonly/>请代建单位审批。
                                            </p>
                                            <div class="signature">
                                                <p>监理单位（章）</p>
                                                <p>专业监理工程师(签字)</p>
                                                <p>总监理工程师</p>
                                            </div>
                                            <p class="signature-date">
                                                <span>年</span>
                                                <span>月</span>
                                                <span>日</span>
                                            </p>   
                                        </td>
                                    </tr>
                                    </if>
                                    <if condition="($audit[5] OR $isAudit eq '2') AND $result['audit_level'] egt 5">
                                    <tr>
                                        <td colspan="4">
                                            代建单位审核意见:
                                            <p class="indent20"> 
                                                本期同意支付工程款为：（小写）<input type="text" class="input-xt input-name"  name="agent_construction_amount" readonly  value="{$result.supervision_amount}" />，（大写）
                                                <input type="text" class="input-xt input-deptname"  name="agent_construction_amount_words" readonly value="{$result.supervision_amount_words}" />请建设单位审批。
                                            </p>
                                            <div class="signature">
                                                <p>代建单位（章）</p>
                                                <p>代建负责人(签章)</p>
                                            </div>
                                            <p class="signature-date">
                                                <span>年</span>
                                                <span>月</span>
                                                <span>日</span>
                                            </p> 
                                        </td>
                                    </tr>
                                    </if>
                                    <if condition="($audit[7] OR $isAudit eq '2') AND $result['audit_level'] egt 7">
                                    <tr>
                                        <td colspan="4">
                                            审批意见:
                                            <p class="indent20"> 
                                                本期同意支付工程款为：（小写）<input type="text" class="input-xt input-name" name="construction_amount" readonly value="{$result.supervision_amount}" />，（大写）
                                                <input type="text" class="input-xt input-deptname"  name="construction_amount_words" readonly value="{$result.supervision_amount_words}" />。
                                            </p>
                                            <div class="signature">
                                                <p>建设单位（盖章）</p>
                                                <p>经办人（签字）</p>
                                                <p>建设单位代表（签字）</p>
                                            </div>
                                            <p class="signature-date">
                                                <span>年</span>
                                                <span>月</span>
                                                <span>日</span>
                                            </p> 
                                        </td>
                                    </tr>
                                    </if>
                                    <if condition="$result['audit_status'] eq '2'">
                                        <tr>
                                            <td colspan="4">
                                                <label>审查意见：
                                                    &nbsp;驳回
                                                </label>
                                                <textarea style="height:50px; width:100%" readonly >{$reject.audit_reason}</textarea>
                                            </td>
                                        </tr>
                                    </if>
                                    <if condition="$isAudit eq '2'">
                                        <tr>
                                            <td colspan="4">
                                                <label>审查意见：
                                                    <label style="width:50px;"><input type="radio" name="audit_status" value="1" checked />&nbsp;同意</label>
                                                    <label style="width:50px;"><input type="radio" name="audit_status" value="2" />&nbsp;驳回</label>
                                                </label>
                                                <textarea style="height:50px; width:100%" name="audit_reason" >{$audit.audit_reason}</textarea>
                                            </td>
                                        </tr>
                                    </if>
                                </table>
                                <if condition="$result['audit_level'] eq 1">
                                	<input type="hidden" name="audit_status" value="1" />
                                	<input type="hidden" name="audit_reason" value="变更保存" />
                                </if>
                                <div class="form-actions">
                                    <if condition="$isAudit eq '2'">
                                    	<a class="btn btn-primary clickBtn" href="javascript:void(0);">{:L('SAVE')}</a>
                                    </if>
                                    <if condition="$result['audit_status'] eq 3">
                                    	<a class="btn btn-warning" href="javascript:$.print('#access');">打印</a>
                                    </if>
                                    <if condition="$result['is_publish'] eq 0">
                                    	<a class="btn btn-warning" href="{:U('PaymentReview/publish', array('id'=>I('request.id/s','')))}">提交审核</a>
                                    </if>
                                    <a class="btn btn-default" href="{:U('PaymentReview/index')}">{:L('BACK')}</a>
                                </div>
                            </form>                   
                        </div>
                    </div>
                </div>
            </div>
        </section>
    </div>
    <script type="text/javascript" src="__PUBLIC__/js/common.js"></script>
    <script type="text/javascript" src="__TMPL__Public/assets/js/convertCurrency.js"></script>
    <script type="text/javascript">
		// 点击保存按钮
		$(".clickBtn").click(function(){
			$(".tips_error").remove();
			var audit_status = $("input[name='audit_status']:checked").val();
			var audit_reason = $("textarea[name='audit_reason']").val();
			if(audit_status == '2' && audit_reason == ""){
				$(".form-actions").append("<span class=\"tips_error\">驳回意见不允许为空！</span>");
				$("textarea[name='audit_reason']").focus()
				return false;
			}
			
			// 表单提交
			$("form").submit();
		});
		$("input[name='supervision_amount']").blur(function(){
			$(this).value(convertCurrency($(this).val()));
		});
		
	</script>
</body>
</html>